package com.hspedu.api;

/**
 * @author 谷其昊
 * @version 1.0
 * @date 2022/3/11
 * @time 21:28
 */
public class Test3 {

    private static boolean flag = true;

    @SuppressWarnings("all")
    public static void main(String[] args) throws InterruptedException {
        new Thread(new Runnable(){
            @Override
            public void run() {
                while (flag){}
                System.out.println("你能看到我吗？");
            }

        }).start();

        Thread.sleep(2000);
        flag = false;
        System.out.println("flag = " + flag);

    }
}
